<p>Using such generic exceptions as <code>Error</code>, <code>RuntimeException</code>, <code>Throwable</code>, and <code>Exception</code> prevents
calling methods from handling true, system-generated exceptions differently than application-generated errors.</p>
<h2>Noncompliant Code Example</h2>
<pre>
public void foo(String bar) throws Throwable {  // Noncompliant
  throw new RuntimeException("My Message");     // Noncompliant
}
</pre>
<h2>Compliant Solution</h2>
<pre>
public void foo(String bar) {
  throw new MyOwnRuntimeException("My Message");
}
</pre>
<h2>Exceptions</h2>
<p>Generic exceptions in the signatures of overriding methods are ignored, because overriding method has to follow signature of the throw declaration
in the superclass. The issue will be raised on superclass declaration of the method (or won’t be raised at all if superclass is not part of the
analysis).</p>
<pre>
@Override
public void myMethod() throws Exception {...}
</pre>
<p>Generic exceptions are also ignored in the signatures of methods that make calls to methods that throw generic exceptions.</p>
<pre>
public void myOtherMethod throws Exception {
  doTheThing();  // this method throws Exception
}
</pre>
<h2>See</h2>
<ul>
  <li> <a href="https://cwe.mitre.org/data/definitions/397.html">MITRE, CWE-397</a> - Declaration of Throws for Generic Exception </li>
  <li> <a href="https://wiki.sei.cmu.edu/confluence/x/_DdGBQ">CERT, ERR07-J.</a> - Do not throw RuntimeException, Exception, or Throwable </li>
</ul>

